<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Controller\api;

use App\Model\Excel;
use xsl\basic\BaseController;

class Generate extends BaseController
{
    public function excel()
    {
        $limit = $this->request->input('limit', 10);
        $result = \Hyperf\Support\make(Excel::class)
            ->with(['admin'])
            ->orderBy('excel_id', 'desc')
            ->paginate();
        return $this->pageSuccess($limit, $result->total(), $result->items());
    }

    public function dashboard()
    {
        $user_count = 0;
        $hotel_count1 = 0;
        $hotel_count2 = 0;
        $hotel_coupon_count1 = 0;
        $hotel_coupon_count2 = 0;
        $hotel_coupon_count3 = 0;

        return $this->success(compact('user_count', 'hotel_count1', 'hotel_count2', 'hotel_coupon_count1', 'hotel_coupon_count2', 'hotel_coupon_count3'));
    }
}
